package com.zch.news.Test;
/**
 * 
 * @ClassName: TestNews 
 * @Description: 测试类
 * @author: zch
 * @version: 1.10
 * @date: 2018年8月29日 下午8:11:42
 */

import org.junit.Test;

import com.zch.news.dao.NewsDao;
import com.zch.news.dao.impl.NewsDaoImpl;
import com.zch.news.entity.News;

public class TestNews {
	NewsDao nd = new NewsDaoImpl();
	@Test
	public void testGetNews() {
		News news = nd.getNewsByNo(666);
		System.out.println(news.getNo());
		System.out.println(news.getTitle());
		System.out.println(news.getContent());
		System.out.println(news.getAuthor());
		System.out.println(news.getCreatTime());
	}
	@Test
	public void testUpdateNews() {
		News news = new News("999", "8888", "王二狗","2017.2.6");
		news.setNo(666);
		boolean flag = nd.updateNews(news);
		if(flag) {
			System.out.println(news.getNo());
			System.out.println(news.getTitle());
			System.out.println(news.getContent());
			System.out.println(news.getAuthor());
			System.out.println(news.getCreatTime());
		}
	}
}
